<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        for (var white = 0; white <= 31; white++) {
            var red = 25 - white;
            var black = 31 - white;
            if (red + black == 28) {
                alert("白球:" + white + "红球" + red + "黑球" + black);
            }
        }
    </script>
</body>

</html>